package com.navajo.components;

import java.util.HashMap;
import java.util.Map;

import com.vaadin.ui.Component;
import com.vaadin.ui.VerticalLayout;

public class CardPaneLayout extends VerticalLayout {
    private Map<String, Component> map = new HashMap<String, Component>();



    public CardPaneLayout() {
    }



    public void addView(Component component) {
        map.put(component.getClass().getName(), component);
        removeAllComponents();
        addComponent(component);
    }



    public void navigateTo(String card) {
        removeAllComponents();
        addComponent(map.get(card));
    }
}
